import yfinance as yf

ticker = "AAPL"
start_date = "2024-08-31"
end_date = "2025-08-31"
data = yf.download(ticker, start=start_date, end=end_date, interval="1d", progress=False)
data.to_csv(f"AAPL_1yr_history_{start_date}_{end_date}.csv")